<?php
    include "../function/config.php";
    include "../function/functionPHP.php";
    include "../class/coop.class.php";
    
    $coopClass=new coop();
    $coopName=$coopClass->getCoopArr();
    
    $mysqli=  connect();
    $query="
        select      *
        from        member
        where       firstName like '%".$_POST["keyword"]."%' or
                    lastName like '%".$_POST["keyword"]."%'
        order by    firstName, lastName
        ";
    $result=  $mysqli->query($query);
    $numrows=  $result->num_rows;
    $i=0;
    while($i<$numrows){
        $row=  $result->fetch_array(MYSQLI_ASSOC);
        ?>    
<div>
    <a href=".?page=member/memberDetail&memID=<?=$row["memID"]?>">
        <memberIcon class="whiteShadow hover">
            <table style="width: 100%;height: 100%;">
                <tr>
                    <td style="text-align: center;">
                        <img class="memberIMG" src="images/member.png"><br>
                        <?=$row["firstName"]." ".$row["lastName"]?><br>
                        <div class="coopName"><?=$coopName[$row["coopID"]]?></div>
                    </td>
                </tr>
            </table>            
        </memberIcon>
    </a>
</div>
            <?php
        $i++;
    }
?>